package org.xteam.sled.semantic.exp;

public class ExpAdd extends ExpBinary {

	public ExpAdd(Exp left, Exp right) {
		super(left, right);
	}
	
	public boolean equals(Object o) {
		return (o instanceof ExpAdd)
			&& ((ExpAdd)o).left.equals(left)
			&& ((ExpAdd)o).right.equals(right);
	}
	
	@Override
	protected TermList toTermList(boolean neg, TermList answers) {
		return left.toTermList(neg, right.toTermList(neg, answers));
	}

	@Override
	public void visit(IExpVisitor visitor) {
		visitor.visitAdd(this);
	}
	
	public String toString() {
		return "(" + left + " + " + right + ")";
	}
	
}
